%% Page X of N pages definition
\newcommand\pageofpages[0]{\thepage / \pageref{LastPage}}

%% Header title
\newcommand\thetitle[0]{Linear communication complexity in SMC}

%% Header/Footer definition for abstract and ToC
\newcommand\hdrone[0] {
  \pagestyle{fancy}
  \fancyhead{}
  \fancyfoot{}
  \fancyhead[C]{\thetitle}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
}

%% Header/Footer definition for rest of document
\newcommand\hdrtwo[0] {
  \pagestyle{fancy}
  \fancyhead{}
  \fancyfoot{}
  \fancyhead[C]{\thetitle}
  \fancyhead[R]{} %\footnotesize \pageofpages}
  \fancyfoot[C]{\pageofpages}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
}

%% Figure with text under it
\newcommand\fig[4] {
  \begin{figure}[h]
    \centering
    \includegraphics[scale=#1]{images/#2}
    \begin{minipage}{0.7\textwidth} 
      \caption{#4} 
      \label{fig:#3}
    \end{minipage}
  \end{figure}
}
%% Subfigures:
%% \figtwo{scalePic1}{Pic1}{Label}{Caption1}
%%        {scalePic2}{Pic2}{Label}{Caption2} 
%%        {\capname{GlobalLabel}{GlobalCaption}}
\newcommand\figtwo[7]{
%  \begin{figure}[htp]
  \begin{figure}[H]
      \begin{center}
        \subfigure[#3]{
          \label{fig:#2}
          \includegraphics[width=0.48\textwidth]{images/#1}}
        \subfigure[#6]{
          \label{fig:#5}
          \includegraphics[width=0.48\textwidth]{images/#4}}
        \begin{minipage}{0.8\textwidth} 
          #7
        \end{minipage}
      \end{center}
  \end{figure}
}

\newcommand\capname[2]{
    \label{fig:#1}
    \caption{#2}
}

%% To reference a figure
\newcommand\reff[1]{\ref{fig:#1}}

%% To reference a section label
\newcommand\refs[1]{\ref{sec:#1}}

%% Emphesize text
\newcommand\keyword[1]{\emph{#1}}

%% Set background coloration of some input
\newcommand\hilight[1] {
  \colorbox{red}{#1}
}

%% Quote
\newcommand\highlight[1]{
  {\it#1}
}


%% New enviroment to skip margins
\newenvironment{custommargins}[2]
  {\addtolength{\leftskip}{#1}\addtolength{\rightskip}{#2}}{\par}

%% Paragraph
\newcommand\BP[0]{\addtolength{\parskip}{-6pt}}
\newcommand\EP[0]{\addtolength{\parskip}{+6pt}}

%% Pretty symbols
\newcommand\w[1]{\mathcal{#1}}


%\newenvironment{protocol}[1][Protocol]{
%  \framed
%    \begin{trivlist}
%    \item[\hskip \labelsep {\bfseries #1}]
%      {
%      \end{trivlist}
%    }
%}

\newenvironment{protocol}[1][Protocol]{
  \begin{trivlist}  
  \item[\hskip \labelsep {\bfseries #1}]}
  {\end{trivlist}}


%\newcommand{\qed}{\nobreak \ifvmode \relax \else
%      \ifdim\lastskip<1.5em \hskip-\lastskip
%      \hskip1.5em plus0em minus0.5em \fi \nobreak
%      \vrule height0.75em width0.5em depth0.25em\fi}
